﻿Imports Entities
Imports Business
Imports DataAccess
Public Class HistorialCLientes

    Private _Cliente As New CLIENTES

    Sub New(ByVal zClienteId As Long)
        InitializeComponent()
        Me._Cliente = ClienteBL.SearchById(zClienteId)
    End Sub

    Private Sub HistorialCLientes_Activated(sender As Object, e As EventArgs) Handles Me.Activated
        If Not IsNothing(_Cliente) Then
            Dim calle = CalleBL.SearchById(_Cliente.CALLE)

            With _Cliente
                tNumero.Text = .NUMERO
                tCalle.Text = calle.NOMBRE
                tVilla.Text = VillaBL.GetNombre(calle.VILLA)
                tNombre.Text = .NOMBRE
                tRut.Text = .RUT
                tFono.Text = .FONO
            End With

        End If

        With gInforme
            .DataSource = ClienteBL.ListHistorial(_Cliente.CLIENTE)
            .Font = New Drawing.Font("Tahoma", Util.GridFont, FontStyle.Regular, GraphicsUnit.Point)
            .Columns("FormaPago").HeaderText = "Forma de Pago"
            .Columns("Observacion").HeaderText = "Observación"
            .Columns("Camion").HeaderText = "Camión"

            .Columns("Monto").DefaultCellStyle.Format = "$ ###,##0"
        End With
    End Sub
    Private Sub HistorialClientes_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        

    End Sub

    Private Sub bCancelar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bCancelar.Click
        Dispose()
    End Sub
End Class